<!-- top menu dove aggiungere funzionalità comuni a tutte le view -->
<div class="navbar navbar-static-top">
	<div class="navbar-minijob " style="background: #eee;">
		<div class="container-fluid">
			<a class="brand" href="<?php echo $this->webroot;?>"><img alt="logo" src=""/></a>
			<div>
				<div class="span7 pull-right" style="padding-right: 20px;">
					<div class="navbar-content">
						<ul class="nav pull-right">
							<li class="dropdown">
								<a id="drop2" class="dropdown-toggle" data-toggle="dropdown" role="button" href="#"> <i class="<?php echo AppController::$flags[Configure::read('Config.language')];?>"></i>
								<b class="caret"></b> </a>
								<ul class="dropdown-menu" aria-labelledby="drop2" role="menu"  style="padding: 0;">
									<li role="presentation">
										<a href='<?php echo $this->webroot;?>Users/lang/ita' tabindex="-1" role="menuitem"><i class="famfamfam-flag-it"></i>&nbsp;<?php echo __("Italiano")?></a>
									</li>
									<li role="presentation">
										<a href='<?php echo $this->webroot;?>Users/lang/eng' tabindex="-1" role="menuitem"><i class="famfamfam-flag-gb"></i>&nbsp;<?php echo __("Inglese")?></a>
									</li>
								</ul>
							</li>
						</ul>
						<?php if(!empty($utente)) { ?>
							<ul class="nav pull-right">
    							    <!-- <span class="label notification-menu">7</span> -->
								<li class="dropdown">
									<a id="drop3" class="dropdown-toggle" data-toggle="dropdown" role="button" href="#"> 
									    <i class="icon-user"></i>&nbsp;<?php echo !$this->request->is('mobile')?$utente['username']:"" ?>
									<b class="caret"></b> </a>
									<ul class="dropdown-menu" aria-labelledby="drop3" role="menu">
	                                    <?php if($this->request->is('mobile')) { ?>
	                                       <li role="presentation" class="notification-header"> <?php echo $utente['username'] ?> </li>
										<?php }?>
										<li role="presentation" <?php echo $this->here==$this->webroot.'Users/profilo'?"class='active'":""  ?> >
											<a href='<?php echo $this->webroot;?>Users/profilo' tabindex="-1" role="menuitem"><?php echo __("Profilo utente");?></a>
										</li>
										<?php foreach ($utente["Jobber"] as $key => $jobber) {  ?>
											<li role="presentation" <?php echo $this->here==$this->webroot.'jobber/profilo/'.$jobber["id"]?"class='active'":""  ?>  >
												<!-- <span class="badge notification">3</span> -->
												<span class="status <?php echo $jobber["stato"]!="A"?"not-active":"" ?>"></span><a href='<?php echo $this->webroot;?>jobber/profilo/<?php echo $jobber["id"]; ?>' tabindex="-1" role="menuitem"><b><?php echo __("Profilo ").$mestieri[$jobber["mestiere_id"]];  ?></b></a> 
											</li>
										<?php } ?>
										<li role="presentation">
											<?php echo $this->Acl->link(__("Diventa jobber"), "/Acl/newjobber", array("tabindex"=>-1, "role"=>"menuitem"),null,null,null,true);  ?>
											<?php echo $this->Acl->link(__("Aggiungi jobber")."&nbsp;&nbsp;&nbsp;<i class='icon-plus'></i>", "/Acl/addjobber", array("tabindex"=>-1, "role"=>"menuitem", "escape"=>false),null,null,null,true);  ?>
										</li>
										<li class="divider" role="presentation"></li>
                                        <li role="presentation" <?php echo $this->here==$this->webroot.'invito/callfriends'?"class='active'":""  ?>>
                                            <a href='<?php echo $this->webroot;?>invito/callfriends' tabindex="-1" role="menuitem"><?php echo __("Invita i tuoi amici")?>&nbsp;&nbsp;&nbsp;<i class='icon-gift'></i></a>
                                        </li>
										<li class="divider" role="presentation"></li>
										<li role="presentation" <?php echo $this->here==$this->webroot.'Users/password'?"class='active'":""  ?>>
											<a href='<?php echo $this->webroot;?>Users/password' tabindex="-1" role="menuitem"><?php echo __("Cambia password")?>&nbsp;&nbsp;&nbsp;<i class='icon-exchange'></i></a>
										</li>
										<?php if ($this->Permission->check("controllers/Upload/index")) { ?>
											<li role="presentation">
												<a href='<?php echo $this->webroot;?>Upload/index' tabindex="-1" role="menuitem"><?php echo __("Attach")?>&nbsp;&nbsp;&nbsp;<i class='icon-download'></i></a>
											</li>
										<?php } ?>
										<?php if ($this->Permission->check("controllers/Parametro/index")) { ?>
											<li role="presentation">
												<a href='<?php echo $this->webroot;?>Parametro/index' tabindex="-1" role="menuitem"><?php echo __("Parametri")?>&nbsp;&nbsp;&nbsp;<i class='icon-cogs'></i></a>
											</li>
										<?php } ?>
										<?php if ($this->Permission->check("controllers/Info/index")) { ?>
											<li role="presentation">
												<a href='<?php echo $this->webroot;?>Info/index' tabindex="-1" role="menuitem"><?php echo __("Info")?></a>
											</li>
										<?php } ?>
										<li class="divider" role="presentation"></li>
										<li role="presentation">
											<a href='<?php echo $this->webroot;?>Users/logout' tabindex="-1" role="menuitem"><?php echo __("Logout")?>&nbsp;&nbsp;&nbsp;<i class='icon-signout'></i></a>
										</li>
									</ul>
								</li>
							</ul>
						<?php }else{ ?>
                            <ul class="nav pull-right">
                                    <li>
                                      <a href="<?php echo $this->webroot;?>Users/login">
                                        <?php echo __("Login"); ?>
                                      </a>
                                    </li>
                                    <li>
                                      <a href="<?php echo $this->webroot;?>Users/login?register=1">
                                        <?php echo __("Registrati"); ?>
                                      </a>
                                    </li>
                              </ul>                     
                        <?php } ?>
					</div>
					<?php if(!empty($utente)) {
				      	echo $this->element('notifica',array("notifiche"=>$notifiche));
                    }?>
					<?php if(!empty($utente)) {
                           if (strlen(strstr( $this->here ,"/Users/profilo"))>0) {?>
                          <ul class="nav pull-right">
                            <li>
                              <a onclick="tour.restart();"><i class="icon-refresh"></i>  Riavvia Tour guidato</a>
                            </li>
                          </ul>           
                    <?php } }?>
				</div><!--/.nav-collapse -->
			</div>
		</div>
	</div>
</div>